import { BackButton, CountDownText } from './components.js';
const mainContext = canvas.getContext('2d');

const step0 = Symbol();
const step1 = Symbol();
const step2 = Symbol();

const countDownText = new CountDownText(mainContext, {
  fillStyle: 'red',
  font: '50px serif',
  textPosition: { x: 100, y: 80 }
}, () => { triggerPageState(step2) });

const backButton = new BackButton(mainContext, {});

let renderQueue = [];

const triggerPageState = (step) => {
  switch (step) {
    case step0:
      renderQueue = [backButton];
      break;
    case step1:
      renderQueue = [countDownText];
      break;
    case step2:
      renderQueue = [];
    default:
      break;
  }
}

export { mainContext, renderQueue, triggerPageState, step0, step1, step2 }